import regexplus.*;
public class Main {
	
	static public void main(String[] args) {
		
		String a = "中国人民大团结万岁，世界人民大团结万岁";
		String[] tok = {"中国","人民","大","团结","万岁","，","世界","人民","大","团结","万岁"};
		String[] pos = {"n1","n","a","a","n","w","n","n","a","a","n"};
		SegmentedString s = new SegmentedString(a,tok,pos);
	
		Pattern.addFunc("f", new f());
		Pattern subpat = Pattern.compile("{^/o}(人民)");
		Pattern.addTag("tag", subpat);
		Pattern pat = Pattern.compile("(({/n}|{/n1})(?#!(58)953哈哈{/l}){/n})(?#={tag}){/a}{/a}{/n}");
		Matcher match = pat.matcher(s);
		while(match.find()) {
			for(int i=0; i<=match.groupCount(); i++) {
				System.out.print(match.group(i)+" ");
			}
			System.out.println();
		}
	}

}

class f implements Function {

	@Override
	public void func(Object[] args) {
		System.out.println("????????");
		
	}
	
}
